%%% a simple example of the use of erlsom.
%%%
-module(erlsom_sax_example).

%% user interface
-export([run/0]).


-export([callback/2]).

run() ->
  case file:read_file("sax_example.xml") of
    {ok, Bin} ->
      erlsom:sax(binary_to_list(Bin), [], {erlsom_sax_example, callback});
    Error ->
      Error
  end.

callback(Event, State) ->
  io:format("~p\n", [Event]),
  State.
